3.325 \(\int (a+b \sec ^2(e+f x))^2 \tan ^3(e+f x) \, dx\)

Optimal. Leaf size=77 \[ \frac {a^2 \log (\cos (e+f x))}{f}+\frac {b (2 a-b) \sec ^4(e+f x)}{4 f}+\frac {a (a-2 b) \sec ^2(e+f x)}{2 f}+\frac {b^2 \sec ^6(e+f x)}{6 f} \]

[Out]

a^2*ln(cos(f*x+e))/f+1/2*a*(a-2*b)*sec(f*x+e)^2/f+1/4*(2*a-b)*b*sec(f*x+e)^4/f+1/6*b^2*sec(f*x+e)^6/f

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4138, 446, 76} \[ \frac {a^2 \log (\cos (e+f x))}{f}+\frac {b (2 a-b) \sec ^4(e+f x)}{4 f}+\frac {a (a-2 b) \sec ^2(e+f x)}{2 f}+\frac {b^2 \sec ^6(e+f x)}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x]^3,x]

[Out]

(a^2*Log[Cos[e + f*x]])/f + (a*(a - 2*b)*Sec[e + f*x]^2)/(2*f) + ((2*a - b)*b*Sec[e + f*x]^4)/(4*f) + (b^2*Sec
[e + f*x]^6)/(6*f)

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {\left (1-x^2\right ) \left (b+a x^2\right )^2}{x^7} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {(1-x) (b+a x)^2}{x^4} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {b^2}{x^4}+\frac {(2 a-b) b}{x^3}+\frac {a (a-2 b)}{x^2}-\frac {a^2}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=\frac {a^2 \log (\cos (e+f x))}{f}+\frac {a (a-2 b) \sec ^2(e+f x)}{2 f}+\frac {(2 a-b) b \sec ^4(e+f x)}{4 f}+\frac {b^2 \sec ^6(e+f x)}{6 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.25, size = 107, normalized size = 1.39 \[ \frac {\cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \left (12 a^2 \log (\cos (e+f x))+3 b (2 a-b) \sec ^4(e+f x)+6 a (a-2 b) \sec ^2(e+f x)+2 b^2 \sec ^6(e+f x)\right )}{3 f (a \cos (2 e+2 f x)+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x]^3,x]

[Out]

(Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2*(12*a^2*Log[Cos[e + f*x]] + 6*a*(a - 2*b)*Sec[e + f*x]^2 + 3*(2*a - b
)*b*Sec[e + f*x]^4 + 2*b^2*Sec[e + f*x]^6))/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 79, normalized size = 1.03 \[ \frac {12 \, a^{2} \cos \left (f x + e\right )^{6} \log \left (-\cos \left (f x + e\right )\right ) + 6 \, {\left (a^{2} - 2 \, a b\right )} \cos \left (f x + e\right )^{4} + 3 \, {\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, b^{2}}{12 \, f \cos \left (f x + e\right )^{6}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^3,x, algorithm="fricas")

[Out]

1/12*(12*a^2*cos(f*x + e)^6*log(-cos(f*x + e)) + 6*(a^2 - 2*a*b)*cos(f*x + e)^4 + 3*(2*a*b - b^2)*cos(f*x + e)
^2 + 2*b^2)/(f*cos(f*x + e)^6)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^3,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-a^2/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(
1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))+2))+a^2/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+e
xp(1)))*(1+cos(f*x+exp(1)))-2))+(-11*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x
+exp(1))))^3*a^2+90*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1))))^2*a^2+
48*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1))))*b^2+96*((1-cos(f*x+exp(
1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1))))*b*a-228*((1-cos(f*x+exp(1)))/(1+cos(f*x+ex
p(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1))))*a^2+32*b^2-192*b*a+184*a^2)*1/24/((1-cos(f*x+exp(1)))/(1+cos
(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))-2)^3)

________________________________________________________________________________________

maple [A]  time = 0.62, size = 103, normalized size = 1.34 \[ \frac {a^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {a^{2} \ln \left (\cos \left (f x +e \right )\right )}{f}+\frac {a b \left (\sin ^{4}\left (f x +e \right )\right )}{2 f \cos \left (f x +e \right )^{4}}+\frac {b^{2} \left (\sin ^{4}\left (f x +e \right )\right )}{6 f \cos \left (f x +e \right )^{6}}+\frac {b^{2} \left (\sin ^{4}\left (f x +e \right )\right )}{12 f \cos \left (f x +e \right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^3,x)

[Out]

1/2/f*a^2*tan(f*x+e)^2+a^2*ln(cos(f*x+e))/f+1/2/f*a*b*sin(f*x+e)^4/cos(f*x+e)^4+1/6/f*b^2*sin(f*x+e)^4/cos(f*x
+e)^6+1/12/f*b^2*sin(f*x+e)^4/cos(f*x+e)^4

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 114, normalized size = 1.48 \[ \frac {6 \, a^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac {6 \, {\left (a^{2} - 2 \, a b\right )} \sin \left (f x + e\right )^{4} - 3 \, {\left (4 \, a^{2} - 6 \, a b - b^{2}\right )} \sin \left (f x + e\right )^{2} + 6 \, a^{2} - 6 \, a b - b^{2}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^3,x, algorithm="maxima")

[Out]

1/12*(6*a^2*log(sin(f*x + e)^2 - 1) - (6*(a^2 - 2*a*b)*sin(f*x + e)^4 - 3*(4*a^2 - 6*a*b - b^2)*sin(f*x + e)^2
 + 6*a^2 - 6*a*b - b^2)/(sin(f*x + e)^6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 - 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.54, size = 92, normalized size = 1.19 \[ \frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {{\left (a+b\right )}^2}{2}+\frac {b^2}{2}-b\,\left (a+b\right )\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {b^2}{4}-\frac {b\,\left (a+b\right )}{2}\right )}{f}-\frac {a^2\,\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^3*(a + b/cos(e + f*x)^2)^2,x)

[Out]

(tan(e + f*x)^2*((a + b)^2/2 + b^2/2 - b*(a + b)))/f - (tan(e + f*x)^4*(b^2/4 - (b*(a + b))/2))/f - (a^2*log(t
an(e + f*x)^2 + 1))/(2*f) + (b^2*tan(e + f*x)^6)/(6*f)

________________________________________________________________________________________

sympy [A]  time = 5.08, size = 128, normalized size = 1.66 \[ \begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {a b \tan ^{2}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{2 f} - \frac {a b \sec ^{2}{\left (e + f x \right )}}{2 f} + \frac {b^{2} \tan ^{2}{\left (e + f x \right )} \sec ^{4}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \sec ^{4}{\left (e + f x \right )}}{12 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\relax (e )}\right )^{2} \tan ^{3}{\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)**2*tan(f*x+e)**3,x)

[Out]

Piecewise((-a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**2/(2*f) + a*b*tan(e + f*x)**2*sec(e + f*x
)**2/(2*f) - a*b*sec(e + f*x)**2/(2*f) + b**2*tan(e + f*x)**2*sec(e + f*x)**4/(6*f) - b**2*sec(e + f*x)**4/(12
*f), Ne(f, 0)), (x*(a + b*sec(e)**2)**2*tan(e)**3, True))

________________________________________________________________________________________